package com.fangzhi.mobel.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class ProductListVo implements Serializable {

    private Long id;
    private String label;
    private Integer level;
    private Boolean disabled = false;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Boolean isDisabled;
    private List<ProductListVo> children;

    public void setLevel(Integer level) {
        this.level = level;
        if (level < 4){
            disabled = true;
            isDisabled = true;
        }
    }
}
